package com.xc.service;

import com.github.pagehelper.PageInfo;
import com.xc.common.ServerResponse;
import com.xc.pojo.Stock;

import javax.servlet.http.HttpServletRequest;

/**
 * @author mipha
 * @version 1.0
 * @date 2019/2/16 3:00 PM
 */
public interface IStockService {

    //  获取大盘指数
    ServerResponse getMarket();

    //  获取股票列表  分页
    ServerResponse getStock(int pageNum , int pageSize , String keyWords);

    //  获取单只股票行情数据
    ServerResponse getSingleStock(String code);

    //  获取单只股票 分钟K线数据
    ServerResponse getMinK(String code,Integer time,Integer ma,Integer size);
    ServerResponse getMinK_Echarts(String code,Integer time,Integer ma,Integer size);


    //  通过名称查股票
    ServerResponse<Stock> findStockByName(String name);
    //  通过代码查股票
    ServerResponse<Stock> findStockByCode(String code);
    //  通过id查股票
    ServerResponse<Stock> findStockById(Integer stockId);


    /**
     *  管理后台
     */
    ServerResponse<PageInfo> listByAdmin(Integer showState ,Integer lockState
            ,String code ,String name ,int pageNum ,int pageSize ,HttpServletRequest request);

    ServerResponse updateLock(Integer stockId);
    ServerResponse updateShow(Integer stockId);

    ServerResponse addStock(String stockName,String stockCode
            ,String stockType,Integer isLock,Integer isShow);

    int CountStockNum();
    int CountShowNum(Integer showState);
    int CountUnLockNum(Integer lockState);



}
